﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Configuration;
namespace VTNT.Framework.Web.Routing
{
    public class RouteSection : ConfigurationSection
    {
        RouteElement element;
        public RouteSection()
        {
            element = new RouteElement();
        }

        [ConfigurationProperty("enabled", IsRequired = false, DefaultValue = true)]
        public bool Enabled
        {
            get { return (bool)base["enabled"]; }
            set { base["enabled"] = value; }
        }

        [ConfigurationProperty("routes", IsDefaultCollection = false)]
        [ConfigurationCollection(typeof(RouteElementCollection),
            AddItemName = "add",
            ClearItemsName = "clear",
            RemoveItemName = "remove")]
        public RouteElementCollection Elements
        {
            get
            {
                return (RouteElementCollection)base["routes"];
            }
        }
    }
}
